package com.formula.datastructure.question.graph;

import com.formula.datastructure.standard.graph.ALEdge;
import com.formula.datastructure.standard.graph.ALVertex;
import com.formula.datastructure.standard.graph.AdjListsGraph;

//Graph BFS
public class GraphBFS {

    public GraphBFS() {
    }

    void BFS(AdjListsGraph graph, int verIdx) {
    }

    private void visit(ALVertex vertex) {
        System.out.println(vertex.data);
    }

    public static void main(String[] args) {
        ALVertex[] vertices = new ALVertex[6];
        ALVertex vertex0 = new ALVertex();
        vertex0.idx = 0;
        vertex0.data = "A";
        ALVertex vertex1 = new ALVertex();
        vertex1.idx = 1;
        vertex1.data = "B";
        ALVertex vertex2 = new ALVertex();
        vertex2.idx = 2;
        vertex2.data = "C";
        ALVertex vertex3 = new ALVertex();
        vertex3.idx = 3;
        vertex3.data = "D";
        ALVertex vertex4 = new ALVertex();
        vertex4.idx = 4;
        vertex4.data = "E";
        ALVertex vertex5 = new ALVertex();
        vertex5.idx = 5;
        vertex5.data = "F";

        ALEdge edgeAB = new ALEdge(1);
        ALEdge edgeAC = new ALEdge(2);
        ALEdge edgeBC = new ALEdge(2);
        ALEdge edgeBD = new ALEdge(3);
        ALEdge edgeCD = new ALEdge(3);
        ALEdge edgeDE = new ALEdge(4);
        ALEdge edgeEF = new ALEdge(5);
        ALEdge edgeFB = new ALEdge(1);
        ALEdge edgeCA = new ALEdge(0);

        vertex0.addEdge(edgeAB);
        vertex0.addEdge(edgeAC);
        vertex1.addEdge(edgeBC);
        vertex1.addEdge(edgeBD);
        vertex2.addEdge(edgeCD);
        vertex3.addEdge(edgeDE);
        vertex4.addEdge(edgeEF);
        vertex5.addEdge(edgeFB);
        vertex2.addEdge(edgeCA);

        vertices[0] = vertex0;
        vertices[1] = vertex1;
        vertices[2] = vertex2;
        vertices[3] = vertex3;
        vertices[4] = vertex4;
        vertices[5] = vertex5;

        AdjListsGraph graph = new AdjListsGraph(vertices);
    }
}
